<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    * {
        padding: 0;
        margin: 0;
    }
    .box {
        width: 44px;
        height: 100%;
        position: fixed;
        top: 0px;
        left: 0px;
        background-color: rgb(24, 51, 105);
        transition: transform 0.3s ease-in-out;
    }
    .box.hidden {
        transform: translateX(-100%);
    }
    .box dl {
        height: 70%;
        display: flex;
        flex-direction: column;
        margin-top: 180px;
    }
    .box dl dd {
        width: 44px;
        height: 60px;
        border: none;
        border-bottom: 1px solid #184E7E;
        border-top: 1px solid #184E7E;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .box dl dd a {
        text-decoration: none;
        color: white;
        font-size: 12px;
    }
    #closeButton{
        background-color: red;
        margin-top: 30px;
        & a{
            font-size: 20px;
        }
    }
    #toggleButton {
        background-color: red;
        color: white;
        width: 44px;
        height: 60px;
       margin-top: -75px;
        position: fixed;
        top: calc(100% - 60px);
        left: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
</style>
<body>
    <div class="box" id="sidebar">
        <dl>
            <dd><a href="#">页游</a></dd>
            <dd><a href="#">手游</a></dd>
            <dd><a href="#">动漫</a></dd>
            <dd><a href="#">漫画</a></dd>
            <dd><a href="#">动画</a></dd>
            <dd><a href="#">小说</a></dd>
            <dd><a href="#">社区</a></dd>
            <dd id="closeButton"><a href="#">X</a></dd>
        </dl>
    </div>
    <div id="toggleButton" style="display: none;">展开</div>

    <script>
        const sidebar = document.getElementById('sidebar');
        const closeButton = document.getElementById('closeButton');
        const toggleButton = document.getElementById('toggleButton');

        closeButton.addEventListener('click', () => {
            sidebar.classList.add('hidden');
            toggleButton.style.display = 'flex';
        });

        toggleButton.addEventListener('click', () => {
            sidebar.classList.remove('hidden');
            toggleButton.style.display = 'none';
        });
    </script>
</body>
</html>